package com.gongren.project.job.orange;

import com.alibaba.dubbo.config.annotation.Reference;
import com.gongren.project.job.odd.OrderTask;
import com.gongren.project.orange.rpc.api.service.taskRpc.IOrangeCallPayTaskService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author houzhong
 * @Date 2017/9/1 12:56
 */
@Component("orangeCallPayTask")
public class OrangeCallPayTask {

    private static final Logger LOGGER = LoggerFactory.getLogger(OrangeCallPayTask.class);

    @Reference
    private IOrangeCallPayTaskService orangeCallPayTaskService;

    /**
     * 每5秒执行一次，充值、提现回调 
     */
    //@Scheduled(cron = "*/5 * * * * ?")
    public void excuteTask() {
        LOGGER.info("OrangeCallPayTask and excuteTask start");
        try {
            orangeCallPayTaskService.findAllExcuteTask();

            LOGGER.info("OrangeCallPayTask and excuteTask end");
        }catch (Exception e) {
            LOGGER.error("OrangeCallPayTask and excuteTask：", e);
        }
    }
}
